<?php
namespace api\common\model;
use think\Db;
class Ticket extends \think\Model 
{
    protected $autoWriteTimestamp = true;
    protected $table = 'ticket';
    protected $sel_ticket_field = array('introduce','left_title','title','remark');
    

    /**
     * 查看券,根据类型
     */
    public function sel_ticket($type){
        $res = null;
        if(!$type){
            $res =Db::name($this->table)->field($this->sel_ticket_field)->select();
        }else{
            $res =Db::name($this->table)->where('ticket_type', $type)->field($this->sel_ticket_field)->select();
        }
        return $res;
   }

}
